home *** CD-ROM | disk | FTP | other *** search
/ Giga Games 1 / Giga Games.iso / net / usenet / volume7 / nethack3 / patch5f < prev    next >
Encoding:
Text File  |  1989-11-08  |  44.5 KB  |  1,627 lines

  1. Subject:  v08i053:  NetHack3 -  display oriented dungeons & dragons (Ver. 3.0), Patch5f
  2. Newsgroups: comp.sources.games
  3. Approved: billr@saab.CNA.TEK.COM
  4.  
  5. Submitted-by: Izchak Miller <izchak@linc.cis.upenn.edu>
  6. Posting-number: Volume 8, Issue 53
  7. Archive-name: NetHack3/Patch5f
  8. Patch-To: NetHack3: Volume 7, Issue 56-93
  9.  
  10. #! /bin/sh
  11. # This is a shell archive.  Remove anything before this line, then unpack
  12. # it by saving it into a file and typing "sh file".  To overwrite existing
  13. # files, type "sh file -c".  You can also feed this as standard input via
  14. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  15. # will see the following message at the end:
  16. #        "End of archive 6 (of 6)."
  17. # Contents:  patches05f
  18. # Wrapped by billr@saab on Tue Oct 17 13:17:13 1989
  19. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  20. if test -f 'patches05f' -a "${1}" != "-c" ; then 
  21.   echo shar: Will not clobber existing file \"'patches05f'\"
  22. else
  23. echo shar: Extracting \"'patches05f'\" \(42408 characters\)
  24. sed "s/^X//" >'patches05f' <<'END_OF_FILE'
  25. X*** src/Old/read.c    Sun Oct 15 18:57:18 1989
  26. X--- src/read.c    Thu Oct 12 16:51:27 1989
  27. X***************
  28. X*** 52,57 ****
  29. X--- 52,58 ----
  30. X          pline("Being blind, you cannot read the formula on the scroll.");
  31. X          return(0);
  32. X          }
  33. X+     scroll->in_use = TRUE;        /* now being read */
  34. X  #ifdef SPELLS
  35. X      if(scroll->olet == SPBOOK_SYM) {
  36. X          if(confused) {
  37. X***************
  38. X*** 911,917 ****
  39. X          return;
  40. X          }
  41. X  #ifdef POLYSELF
  42. X!         else if ((how & REALLY) && ptr == &mons[u.umonnum]) rehumanize();
  43. X  #endif
  44. X          ptr->geno |= G_GENOD;
  45. X          for(mtmp = fmon; mtmp; mtmp = mtmp2) {
  46. X--- 912,918 ----
  47. X          return;
  48. X          }
  49. X  #ifdef POLYSELF
  50. X!         else if (ptr == uasmon) rehumanize();
  51. X  #endif
  52. X          ptr->geno |= G_GENOD;
  53. X          for(mtmp = fmon; mtmp; mtmp = mtmp2) {
  54. X*** src/Old/restore.c    Sun Oct 15 18:58:06 1989
  55. X--- src/restore.c    Sat Oct 14 22:42:55 1989
  56. X***************
  57. X*** 90,95 ****
  58. X--- 90,100 ----
  59. X          else otmp2->nobj = otmp;
  60. X          mread(fd, (genericptr_t) otmp, (unsigned) xl + sizeof(struct obj));
  61. X          if(!otmp->o_id) otmp->o_id = flags.ident++;
  62. X+     /* Things that were marked "in_use" when the game was saved (eg. via
  63. X+      * the infamous "HUP" cheat get used up here.
  64. X+      */
  65. X+         if(otmp->olet != ARMOR_SYM && otmp->olet != WEAPON_SYM
  66. X+             && otmp->otyp != PICK_AXE && otmp->in_use) useup(otmp);
  67. X  #ifdef TUTTI_FRUTTI
  68. X          if(ghostly && otmp->otyp == SLIME_MOLD) {
  69. X              for(oldf=oldfruit; oldf; oldf=oldf->nextf)
  70. X***************
  71. X*** 127,133 ****
  72. X      off_t differ;
  73. X  
  74. X      mread(fd, (genericptr_t)&monbegin, sizeof(monbegin));
  75. X! #if !defined(MSDOS) && !defined(M_XENIX)
  76. X      differ = (genericptr_t)(&mons[0]) - (genericptr_t)(monbegin);
  77. X  #else
  78. X      differ = (long)(&mons[0]) - (long)(monbegin);
  79. X--- 132,138 ----
  80. X      off_t differ;
  81. X  
  82. X      mread(fd, (genericptr_t)&monbegin, sizeof(monbegin));
  83. X! #if !defined(MSDOS) && !defined(M_XENIX) && !defined(THINKC4)
  84. X      differ = (genericptr_t)(&mons[0]) - (genericptr_t)(monbegin);
  85. X  #else
  86. X      differ = (long)(&mons[0]) - (long)(monbegin);
  87. X***************
  88. X*** 146,152 ****
  89. X          mread(fd, (genericptr_t) mtmp, (unsigned) xl + sizeof(struct monst));
  90. X          if(!mtmp->m_id)
  91. X              mtmp->m_id = flags.ident++;
  92. X! #if !defined(MSDOS) && !defined(M_XENIX)
  93. X          /* ANSI type for differ is ptrdiff_t --
  94. X           * long may be wrong for segmented architecture --
  95. X           * may be better to cast pointers to (struct permonst *)
  96. X--- 151,157 ----
  97. X          mread(fd, (genericptr_t) mtmp, (unsigned) xl + sizeof(struct monst));
  98. X          if(!mtmp->m_id)
  99. X              mtmp->m_id = flags.ident++;
  100. X! #if !defined(MSDOS) && !defined(M_XENIX) && !defined(THINKC4)
  101. X          /* ANSI type for differ is ptrdiff_t --
  102. X           * long may be wrong for segmented architecture --
  103. X           * may be better to cast pointers to (struct permonst *)
  104. X***************
  105. X*** 281,287 ****
  106. X  #endif
  107. X  
  108. X      restnames(fd);
  109. X! #ifdef DGK
  110. X      msmsg("\n");
  111. X      cl_end();
  112. X      msmsg("You got as far as level %d%s.\n", maxdlevel,
  113. X--- 286,295 ----
  114. X  #endif
  115. X  
  116. X      restnames(fd);
  117. X! #if defined(DGK) || defined(MACOS)
  118. X! # ifdef MACOS
  119. X! #define msmsg printf
  120. X! # endif
  121. X      msmsg("\n");
  122. X      cl_end();
  123. X      msmsg("You got as far as level %d%s.\n", maxdlevel,
  124. X***************
  125. X*** 299,311 ****
  126. X              break;
  127. X          getlev(fd, 0, ltmp, FALSE);
  128. X          glo(ltmp);
  129. X! #ifdef DGK
  130. X          msmsg(".");
  131. X  #endif
  132. X  #if defined(MSDOS) && !defined(TOS)
  133. X          nfd = open(lock, O_WRONLY | O_BINARY | O_CREAT | O_TRUNC, FCMASK);
  134. X  #else
  135. X          nfd = creat(lock, FCMASK);
  136. X  #endif
  137. X          if (nfd < 0)    panic("Cannot open temp file %s!\n", lock);
  138. X  #if defined(DGK) && !defined(OLD_TOS)
  139. X--- 307,343 ----
  140. X              break;
  141. X          getlev(fd, 0, ltmp, FALSE);
  142. X          glo(ltmp);
  143. X! #if defined(DGK) || defined(MACOS)
  144. X          msmsg(".");
  145. X  #endif
  146. X  #if defined(MSDOS) && !defined(TOS)
  147. X          nfd = open(lock, O_WRONLY | O_BINARY | O_CREAT | O_TRUNC, FCMASK);
  148. X  #else
  149. X+ # ifdef MACOS
  150. X+         {
  151. X+             Str255    fileName;
  152. X+             OSErr    er;
  153. X+             struct term_info    *t;
  154. X+             short    oldVolume;
  155. X+             extern WindowPtr    HackWindow;
  156. X+             
  157. X+             t = (term_info *)GetWRefCon(HackWindow);
  158. X+             (void)GetVol(&fileName, &oldVolume);
  159. X+             (void)SetVol(0L, t->system.sysVRefNum);
  160. X+             fileName[0] = (uchar)strlen(lock);
  161. X+             Strcpy((char *)&fileName[1], lock);
  162. X+             
  163. X+             if (er = Create(&fileName, 0, CREATOR, LEVEL_TYPE))
  164. X+                 SysBeep(1);
  165. X+             else {
  166. X+                 msmsg(".");
  167. X+                 nfd = open(lock, O_WRONLY | O_BINARY);
  168. X+             }
  169. X+             (void)SetVol(0L, oldVolume);
  170. X+         }
  171. X+ # else
  172. X          nfd = creat(lock, FCMASK);
  173. X+ # endif /* MACOS */
  174. X  #endif
  175. X          if (nfd < 0)    panic("Cannot open temp file %s!\n", lock);
  176. X  #if defined(DGK) && !defined(OLD_TOS)
  177. X***************
  178. X*** 470,476 ****
  179. X--- 502,531 ----
  180. X          done(TRICKED);
  181. X      }
  182. X  
  183. X+ #if defined(SMALLDATA) && defined(MACOS)
  184. X+     {
  185. X+     /* this assumes that the size of a row of struct rm's is <128 */
  186. X+         short    i, length, j;
  187. X+         char    *ptr, *src, *p, *d;
  188. X+         
  189. X+         d = calloc(ROWNO*COLNO, sizeof(struct rm));
  190. X+         p = d;
  191. X+         mread(fd, (genericptr_t)&j, sizeof(short));
  192. X+         mread(fd, (genericptr_t)d, j);
  193. X+         for (i = 0; i < COLNO; i++) {
  194. X+             length = (short)(*p++);
  195. X+             ptr = p;
  196. X+             src = (char *)&levl[i][0];
  197. X+             UnpackBits(&ptr, &src, ROWNO * sizeof(struct rm));
  198. X+             if ((ptr - p) != length) 
  199. X+                 panic("restore - corrupted file on unpacking\n");
  200. X+             p = ptr;
  201. X+         }
  202. X+         free(d);
  203. X+     }
  204. X+ #else
  205. X      mread(fd, (genericptr_t) levl, sizeof(levl));
  206. X+ #endif
  207. X      mread(fd, (genericptr_t) &osymbol, sizeof(osymbol));
  208. X      if (memcmp((genericptr_t) &osymbol,
  209. X             (genericptr_t) &showsyms, sizeof (struct symbols))
  210. X***************
  211. X*** 635,641 ****
  212. X  
  213. X      /* regenerate animals while on another level */
  214. X      { long tmoves = (moves > omoves) ? moves-omoves : 0;
  215. X!       register struct monst *mtmp, *mtmp2;
  216. X  
  217. X        for(mtmp = fmon; mtmp; mtmp = mtmp2) {
  218. X  
  219. X--- 690,696 ----
  220. X  
  221. X      /* regenerate animals while on another level */
  222. X      { long tmoves = (moves > omoves) ? moves-omoves : 0;
  223. X!       register struct monst *mtmp2;
  224. X  
  225. X        for(mtmp = fmon; mtmp; mtmp = mtmp2) {
  226. X  
  227. X*** src/Old/rumors.c    Sun Oct 15 18:59:09 1989
  228. X--- src/rumors.c    Sat Oct 14 22:43:14 1989
  229. X***************
  230. X*** 111,117 ****
  231. X--- 111,123 ----
  232. X      Strcat(tmp,RUMORFILE);
  233. X      if(rumors = fopen(tmp, "r")) {
  234. X  #else
  235. X+ # ifdef MACOS
  236. X+     if(rumors = fopen(RUMORFILE, "r"))
  237. X+         rumors = openFile(RUMORFILE);
  238. X+     if (rumors) {
  239. X+ # else
  240. X      if(rumors = fopen(RUMORFILE, "r")) {
  241. X+ # endif
  242. X  #endif
  243. X          if (!end_rumor_file) {    /* if this is the first outrumor() */
  244. X              init_rumors();
  245. X***************
  246. X*** 169,175 ****
  247. X--- 175,187 ----
  248. X      Strcat(tmp,ORACLEFILE);
  249. X      if(oracles = fopen(tmp, "r")) {
  250. X  #else
  251. X+ # ifdef MACOS
  252. X+     if(oracles = fopen(ORACLEFILE, "r"))
  253. X+         oracles = openFile(ORACLEFILE);
  254. X+     if (oracles) {
  255. X+ # else
  256. X      if(oracles = fopen(ORACLEFILE, "r")) {
  257. X+ # endif
  258. X  #endif
  259. X          if (!oracle_size) {    /* if this is the first outrumor() */
  260. X              init_rumors();
  261. X*** src/Old/save.c    Sun Oct 15 18:59:27 1989
  262. X--- src/save.c    Sat Oct 14 22:44:55 1989
  263. X***************
  264. X*** 14,20 ****
  265. X  #ifndef NO_SIGNAL
  266. X  #include <signal.h>
  267. X  #endif /* !NO_SIGNAL */
  268. X! #if defined(EXPLORE_MODE) && !defined(O_RDONLY)
  269. X  #include <fcntl.h>
  270. X  #endif /* EXPLORE_MODE */
  271. X  
  272. X--- 14,20 ----
  273. X  #ifndef NO_SIGNAL
  274. X  #include <signal.h>
  275. X  #endif /* !NO_SIGNAL */
  276. X! #if defined(EXPLORE_MODE) && !defined(LSC) && !defined(O_RDONLY)
  277. X  #include <fcntl.h>
  278. X  #endif /* EXPLORE_MODE */
  279. X  
  280. X***************
  281. X*** 100,105 ****
  282. X--- 100,108 ----
  283. X  #ifdef COMPRESS
  284. X      char    cmd[80];
  285. X  #endif
  286. X+ #ifdef MACOS
  287. X+     short    savenum;
  288. X+ #endif
  289. X  
  290. X      if (!SAVEF[0])
  291. X          return 0;
  292. X***************
  293. X*** 107,113 ****
  294. X  #if defined(UNIX) || defined(VMS)
  295. X      (void) signal(SIGHUP, SIG_IGN);
  296. X  #endif
  297. X! #if !defined(__TURBOC__) && !defined(OLD_TOS)
  298. X      (void) signal(SIGINT, SIG_IGN);
  299. X  #endif
  300. X  
  301. X--- 110,116 ----
  302. X  #if defined(UNIX) || defined(VMS)
  303. X      (void) signal(SIGHUP, SIG_IGN);
  304. X  #endif
  305. X! #if !defined(__TURBOC__) && !defined(OLD_TOS) && !defined(NO_SIGNAL)
  306. X      (void) signal(SIGINT, SIG_IGN);
  307. X  #endif
  308. X  
  309. X***************
  310. X*** 144,150 ****
  311. X--- 147,185 ----
  312. X          }
  313. X      }
  314. X  # endif
  315. X+ # ifdef MACOS
  316. X+     {
  317. X+         Str255    fileName;
  318. X+         OSErr    er;
  319. X+         OSType    fileType;
  320. X+         Point    where;
  321. X+         SFReply    reply;
  322. X+         char    *prompt;
  323. X+         
  324. X+         savenum = 0;
  325. X+         (void)GetVol(&fileName, &tmp);
  326. X+         Strcpy((char *)&fileName[1], SAVEF);
  327. X+         fileName[0] = strlen(SAVEF);
  328. X+         where.h = where.v =
  329. X+             (SCREEN_BITS.bounds.bottom - SCREEN_BITS.bounds.top) / 4;
  330. X+         prompt = "\022Save character in:";
  331. X+         SFPutFile(where, prompt, fileName, 0L, &reply);
  332. X+         if (reply.good) {
  333. X+             SetVol(0L, savenum = reply.vRefNum);
  334. X+             strncpy(SAVEF, (char *)&reply.fName[1],
  335. X+                     (short)reply.fName[0]);
  336. X+             SAVEF[(short)reply.fName[0]] = '\0';
  337. X+             Strcpy((char *)fileName, (char *)reply.fName);
  338. X+         }
  339. X+         
  340. X+         fileType = (discover == TRUE) ? EXPLORE_TYPE : SAVE_TYPE;
  341. X+         if (er = Create(&fileName, 0, CREATOR, fileType))
  342. X+             SysBeep(1);
  343. X+     }
  344. X+     fd = open(SAVEF, O_WRONLY | O_BINARY);
  345. X+ # else
  346. X      fd = creat(SAVEF, FCMASK);
  347. X+ # endif /* MACOS */
  348. X  #endif /* MSDOS */
  349. X      if(fd < 0) {
  350. X          if(!hu) pline("Cannot open save file.");
  351. X***************
  352. X*** 151,156 ****
  353. X--- 186,194 ----
  354. X          (void) unlink(SAVEF);        /* ab@unido */
  355. X          return(0);
  356. X      }
  357. X+ #ifdef MACOS
  358. X+     (void)SetVol(0L,tmp);
  359. X+ #endif
  360. X      if(flags.moonphase == FULL_MOON)    /* ut-sally!fletcher */
  361. X          change_luck(-1);        /* and unido!ab */
  362. X      home();
  363. X***************
  364. X*** 162,167 ****
  365. X--- 200,208 ----
  366. X      savelev(fd, dlevel, mode);
  367. X      /* count_only will be set properly by savelev */
  368. X  #else
  369. X+ # ifdef MACOS
  370. X+     printf("Saving: ");
  371. X+ # endif
  372. X      savelev(fd,dlevel);
  373. X  #endif
  374. X      saveobjchn(fd, invent);
  375. X***************
  376. X*** 240,251 ****
  377. X          if(ltmp == dlevel || !level_exists[ltmp]) continue;
  378. X  #endif
  379. X          glo(ltmp);
  380. X! #ifdef DGK
  381. X          if(!hu) msmsg(".");
  382. X  #endif
  383. X          if((ofd = open(lock, OMASK)) < 0) {
  384. X              if(!hu) pline("Error while saving: cannot read %s.", lock);
  385. X              (void) close(fd);
  386. X              (void) unlink(SAVEF);
  387. X              if(!hu) done(TRICKED);
  388. X              return(0);
  389. X--- 281,298 ----
  390. X          if(ltmp == dlevel || !level_exists[ltmp]) continue;
  391. X  #endif
  392. X          glo(ltmp);
  393. X! #if defined(DGK) || defined(MACOS)
  394. X! # ifdef MACOS
  395. X! #define msmsg printf
  396. X! # endif
  397. X          if(!hu) msmsg(".");
  398. X  #endif
  399. X          if((ofd = open(lock, OMASK)) < 0) {
  400. X              if(!hu) pline("Error while saving: cannot read %s.", lock);
  401. X              (void) close(fd);
  402. X+ #ifdef MACOS
  403. X+             (void)SetVol(0L, savenum);
  404. X+ #endif
  405. X              (void) unlink(SAVEF);
  406. X              if(!hu) done(TRICKED);
  407. X              return(0);
  408. X***************
  409. X*** 349,355 ****
  410. X--- 396,427 ----
  411. X  #else
  412. X      bwrite(fd,(genericptr_t) &lev,sizeof(lev));
  413. X  #endif
  414. X+ #if defined(SMALLDATA) && defined(MACOS)
  415. X+     /* asssumes ROWNO*sizeof(struct rm) < 128 bytes */
  416. X+     {
  417. X+         short    i;
  418. X+         char    length;
  419. X+         char    bufr[256],*ptr,*src,*d,*p;
  420. X+         
  421. X+         d = calloc(ROWNO*COLNO, sizeof(struct rm));
  422. X+         p = d;
  423. X+         for (i = 0; i < COLNO; i++) {
  424. X+             ptr = &bufr[0];
  425. X+             src = (char *)&levl[i][0];
  426. X+             PackBits(&src, &ptr, ROWNO * sizeof(struct rm));
  427. X+             length = (char)(ptr - &bufr[0]);
  428. X+             BlockMove(&length, p++, (Size)1);
  429. X+             BlockMove(bufr, p, (Size)length);
  430. X+             p += (long)length;
  431. X+         }
  432. X+         i = (short)(p - d);
  433. X+         bwrite(fd, (genericptr_t)&i, sizeof(short));
  434. X+         bwrite(fd, (genericptr_t)d, i);
  435. X+         free(d);
  436. X+     }
  437. X+ #else
  438. X      bwrite(fd,(genericptr_t) levl,sizeof(levl));
  439. X+ #endif /* SMALLDATA */
  440. X  #ifdef REINCARNATION
  441. X      if(dlevel == rogue_level && lev != rogue_level)
  442. X          /* save the symbols actually used to represent the level, not
  443. X*** src/Old/shk.c    Sun Oct 15 19:00:18 1989
  444. X--- src/shk.c    Sun Oct 15 17:25:15 1989
  445. X***************
  446. X*** 291,296 ****
  447. X--- 291,308 ----
  448. X          ESHK(mtmp)->shoplevel == dlevel));
  449. X  }
  450. X  
  451. X+ boolean
  452. X+ tended_shop(roomno)
  453. X+ register int roomno;
  454. X+ {
  455. X+     register struct monst *mtmp;
  456. X+ 
  457. X+     for(mtmp = fmon; mtmp; mtmp = mtmp->nmon)
  458. X+         if(mtmp->isshk && ESHK(mtmp)->shoproom == roomno
  459. X+         && inhishop(mtmp)) return(TRUE);
  460. X+     return(FALSE);
  461. X+ }
  462. X+ 
  463. X  static void
  464. X  findshk(roomno)
  465. X  register int roomno;
  466. X***************
  467. X*** 703,712 ****
  468. X              }
  469. X  
  470. X              if (invent) {
  471. X!                 for(otmp = invent; otmp; otmp = otmp->nobj) {
  472. X                  place_object(otmp, ox, oy);
  473. X-                 otmp->age = 0;
  474. X-                 }
  475. X  
  476. X                  /* add to main object list at end so invent is
  477. X                     still good */
  478. X--- 715,722 ----
  479. X              }
  480. X  
  481. X              if (invent) {
  482. X!                 for(otmp = invent; otmp; otmp = otmp->nobj)
  483. X                  place_object(otmp, ox, oy);
  484. X  
  485. X                  /* add to main object list at end so invent is
  486. X                     still good */
  487. X***************
  488. X*** 925,931 ****
  489. X  
  490. X      if(!costly_spot(u.ux,u.uy))
  491. X          return;
  492. X!     subfrombill(obj);
  493. X      /* you dropped something of your own - probably want to sell it */
  494. X      if(shopkeeper->msleep || shopkeeper->mfroz || !inhishop(shopkeeper))
  495. X          return;
  496. X--- 935,944 ----
  497. X  
  498. X      if(!costly_spot(u.ux,u.uy))
  499. X          return;
  500. X!     if(obj->unpaid) {
  501. X!         subfrombill(obj);
  502. X!         return;
  503. X!     }
  504. X      /* you dropped something of your own - probably want to sell it */
  505. X      if(shopkeeper->msleep || shopkeeper->mfroz || !inhishop(shopkeeper))
  506. X          return;
  507. X***************
  508. X*** 1044,1050 ****
  509. X      case FOOD_SYM:
  510. X          /* simpler hunger check, (2-4)*cost */
  511. X          if (u.uhs >= HUNGRY) tmp *= u.uhs;
  512. X!         if (OEATEN(obj)) tmp /= 2;        /* partly eaten */
  513. X          break;
  514. X      case WAND_SYM:
  515. X          if (obj->spe == -1) tmp = 0;
  516. X--- 1057,1063 ----
  517. X      case FOOD_SYM:
  518. X          /* simpler hunger check, (2-4)*cost */
  519. X          if (u.uhs >= HUNGRY) tmp *= u.uhs;
  520. X!         if (obj->oeaten) tmp /= 2;        /* partly eaten */
  521. X          break;
  522. X      case WAND_SYM:
  523. X          if (obj->spe == -1) tmp = 0;
  524. X*** src/Old/sounds.c    Sun Oct 15 19:01:49 1989
  525. X--- src/sounds.c    Tue Oct  3 21:46:49 1989
  526. X***************
  527. X*** 179,185 ****
  528. X          }
  529. X          break;
  530. X          case SHOPBASE:
  531. X!         switch (rn2(2)+hallu) {
  532. X              case 0:
  533. X              You("hear the chime of a cash register.");
  534. X              break;
  535. X--- 179,186 ----
  536. X          }
  537. X          break;
  538. X          case SHOPBASE:
  539. X!         if(tended_shop(croomno))
  540. X!           switch (rn2(2)+hallu) {
  541. X              case 0:
  542. X              You("hear the chime of a cash register.");
  543. X              break;
  544. X***************
  545. X*** 189,195 ****
  546. X              case 2:
  547. X              You("seem to hear Neiman and Marcus arguing!");
  548. X              break;
  549. X!         }
  550. X          break;
  551. X          default:
  552. X          break;
  553. X--- 190,196 ----
  554. X              case 2:
  555. X              You("seem to hear Neiman and Marcus arguing!");
  556. X              break;
  557. X!           }
  558. X          break;
  559. X          default:
  560. X          break;
  561. X*** src/Old/steal.c    Mon Oct 16 13:23:36 1989
  562. X--- src/steal.c    Mon Oct 16 13:16:26 1989
  563. X***************
  564. X*** 115,124 ****
  565. X      }
  566. X  
  567. X      tmp = 0;
  568. X!     for(otmp = invent; otmp; otmp = otmp->nobj) if(otmp != uarmc)
  569. X          tmp += ((otmp->owornmask & (W_ARMOR | W_RING | W_AMUL | W_TOOL)) ? 5 : 1);
  570. X      tmp = rn2(tmp);
  571. X!     for(otmp = invent; otmp; otmp = otmp->nobj) if(otmp != uarmc)
  572. X            if((tmp -= ((otmp->owornmask & (W_ARMOR | W_RING | W_AMUL | W_TOOL)) ? 5 : 1))
  573. X              < 0) break;
  574. X      if(!otmp) {
  575. X--- 115,124 ----
  576. X      }
  577. X  
  578. X      tmp = 0;
  579. X!     for(otmp = invent; otmp; otmp = otmp->nobj) if(!uarm || otmp != uarmc)
  580. X          tmp += ((otmp->owornmask & (W_ARMOR | W_RING | W_AMUL | W_TOOL)) ? 5 : 1);
  581. X      tmp = rn2(tmp);
  582. X!     for(otmp = invent; otmp; otmp = otmp->nobj) if(!uarm || otmp != uarmc)
  583. X            if((tmp -= ((otmp->owornmask & (W_ARMOR | W_RING | W_AMUL | W_TOOL)) ? 5 : 1))
  584. X              < 0) break;
  585. X      if(!otmp) {
  586. X***************
  587. X*** 151,157 ****
  588. X              break;
  589. X          case ARMOR_SYM:
  590. X              if(multi < 0 || otmp == uarms){
  591. X!               setworn((struct obj *) 0, otmp->owornmask & W_ARMOR);
  592. X                break;
  593. X              }
  594. X          { int curssv = otmp->cursed;
  595. X--- 151,163 ----
  596. X              break;
  597. X          case ARMOR_SYM:
  598. X              if(multi < 0 || otmp == uarms){
  599. X!               if (otmp == uarm)  (void) Armor_off();
  600. X!               else if (otmp == uarmc) (void) Cloak_off();
  601. X!               else if (otmp == uarmf) (void) Boots_off();
  602. X!               else if (otmp == uarmg) (void) Gloves_off();
  603. X!               else if (otmp == uarmh) (void) Helmet_off();
  604. X!               else if (otmp == uarms) (void) Shield_off();
  605. X!               else setworn((struct obj *)0, otmp->owornmask & W_ARMOR);
  606. X                break;
  607. X              }
  608. X          { int curssv = otmp->cursed;
  609. X***************
  610. X*** 229,234 ****
  611. X--- 235,241 ----
  612. X          mpickobj(mtmp,otmp);
  613. X          pline("%s stole %s!", Monnam(mtmp), doname(otmp));
  614. X          rloc(mtmp);
  615. X+         return;
  616. X          }
  617. X      }
  618. X  }
  619. X*** src/Old/termcap.c    Sun Oct 15 19:03:02 1989
  620. X--- src/termcap.c    Sun Oct 15 13:05:24 1989
  621. X***************
  622. X*** 2,15 ****
  623. X  /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
  624. X  /* NetHack may be freely redistributed.  See license for details. */
  625. X  
  626. X- #include <ctype.h>    /* for isdigit() */
  627. X- 
  628. X  /* block some unused #defines to avoid overloading some cpp's */
  629. X  #define MONATTK_H
  630. X  #include "hack.h"    /* for ROWNO, COLNO, *HI, *HE, *AS, *AE */
  631. X  
  632. X  #ifndef MSDOS
  633. X  # define TERMLIB    /* include termcap code */
  634. X  #endif
  635. X  
  636. X  #if !defined(SYSV) || defined(TOS) || defined(UNIXPC)
  637. X--- 2,17 ----
  638. X  /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
  639. X  /* NetHack may be freely redistributed.  See license for details. */
  640. X  
  641. X  /* block some unused #defines to avoid overloading some cpp's */
  642. X  #define MONATTK_H
  643. X  #include "hack.h"    /* for ROWNO, COLNO, *HI, *HE, *AS, *AE */
  644. X  
  645. X+ #include <ctype.h>    /* for isdigit() */
  646. X+ 
  647. X  #ifndef MSDOS
  648. X+ # ifndef MACOS
  649. X  # define TERMLIB    /* include termcap code */
  650. X+ # endif
  651. X  #endif
  652. X  
  653. X  #if !defined(SYSV) || defined(TOS) || defined(UNIXPC)
  654. X***************
  655. X*** 63,79 ****
  656. X  startup()
  657. X  {
  658. X  #ifdef TERMLIB
  659. X!     register char *term = getenv("TERM");
  660. X      register char *tptr;
  661. X      char *tbufptr, *pc;
  662. X  #endif
  663. X      register int i;
  664. X  
  665. X      /* Set the default map symbols */
  666. X      (void) memcpy((genericptr_t) &showsyms, 
  667. X          (genericptr_t) &defsyms, sizeof(struct symbols));
  668. X  
  669. X! #if !defined(AMIGA) && !defined(TOS)
  670. X  # if defined(TERMLIB) || !(defined(DECRAINBOW) || defined(OS2))
  671. X  #  define IBMXASCII
  672. X  # endif
  673. X--- 65,90 ----
  674. X  startup()
  675. X  {
  676. X  #ifdef TERMLIB
  677. X!     register char *term;
  678. X      register char *tptr;
  679. X      char *tbufptr, *pc;
  680. X  #endif
  681. X      register int i;
  682. X  
  683. X+ #ifdef TERMLIB
  684. X+ # ifdef VMS
  685. X+     term = getenv("EMACS_TERM");
  686. X+     if (!term)
  687. X+         term = getenv("NETHACK_TERM");
  688. X+     if (!term)
  689. X+ # endif
  690. X+     term = getenv("TERM");
  691. X+ #endif
  692. X      /* Set the default map symbols */
  693. X      (void) memcpy((genericptr_t) &showsyms, 
  694. X          (genericptr_t) &defsyms, sizeof(struct symbols));
  695. X  
  696. X! #if !defined(AMIGA) && !defined(TOS) && !defined(MACOS)
  697. X  # if defined(TERMLIB) || !(defined(DECRAINBOW) || defined(OS2))
  698. X  #  define IBMXASCII
  699. X  # endif
  700. X***************
  701. X*** 120,125 ****
  702. X--- 131,175 ----
  703. X  #if defined(TOS) && defined(__GNUC__) && defined(TERMLIB)
  704. X          term = "st52";        /* library has a default */
  705. X  #else
  706. X+ # ifdef MACOS
  707. X+     /* dummy termcap for the Mac */
  708. X+     HO = "\033[H";
  709. X+     CL = "\033[2J";     /* a pseudo-ANSI termcap */
  710. X+     CE = "\033[K";
  711. X+     CM = "\033[%d;%dH"; /* not used */
  712. X+     UP = "\033[A";
  713. X+     ND = "\033[C";
  714. X+     XD = "\033[B";
  715. X+      BC = "\033[D";
  716. X+      TI = TE = SE = UE = US = HE = "\033[0m";
  717. X+      SO = "\033[1m";
  718. X+      AS = VS = VE = AE = "";
  719. X+      CO = COLNO;
  720. X+      LI = ROWNO + 3;
  721. X+      /* use special font ? */
  722. X+     {
  723. X+         extern short macflags;
  724. X+         if (macflags & fUseCustomFont)
  725. X+         {
  726. X+         Handle  theRes;
  727. X+         unsigned char   *sym;
  728. X+         short   i;
  729. X+ 
  730. X+         sym = &showsyms.stone;
  731. X+         theRes = GetResource(HACK_DATA,102);
  732. X+         HLock(theRes);
  733. X+         strncpy((char *)sym,(char *)(*theRes),32);
  734. X+         HUnlock(theRes);
  735. X+         ReleaseResource(theRes);
  736. X+         }
  737. X+     }
  738. X+ #  ifdef TEXTCOLOR
  739. X+     for (i = 0; i < MAXCOLORS; i++) {
  740. X+         hilites[i] = (char *) alloc(sizeof("E[cc"));
  741. X+         Sprintf(hilites[i], "\033[c%c", (char)(i+'a'));
  742. X+     }
  743. X+ #  endif
  744. X+ # else /* MACOS */
  745. X  # ifdef ANSI_DEFAULT
  746. X  #  ifdef TOS
  747. X      {
  748. X***************
  749. X*** 190,195 ****
  750. X--- 240,246 ----
  751. X  # else
  752. X          error("Can't get TERM.");
  753. X  # endif /* ANSI_DEFAULT */
  754. X+ # endif /* MACOS */
  755. X  #endif /* __GNUC__ */
  756. X  #ifdef TERMLIB
  757. X      tptr = (char *) alloc(1024);
  758. X***************
  759. X*** 401,407 ****
  760. X--- 452,462 ----
  761. X  cmov(x, y)
  762. X  register int x, y;
  763. X  {
  764. X+ #ifdef MACOS
  765. X+     mcurs(x-1, y-1);
  766. X+ #else
  767. X      xputs(tgoto(CM, x-1, y-1));
  768. X+ #endif
  769. X      cury = y;
  770. X      curx = x;
  771. X  }
  772. X***************
  773. X*** 410,416 ****
  774. X--- 465,475 ----
  775. X  xputc(c)
  776. X  char c;
  777. X  {
  778. X+ #ifdef MACOS
  779. X+     mputc(c);
  780. X+ #else
  781. X      (void) fputc(c, stdout);
  782. X+ #endif
  783. X  }
  784. X  
  785. X  void
  786. X***************
  787. X*** 417,430 ****
  788. X  xputs(s)
  789. X  char *s;
  790. X  {
  791. X! #ifndef TERMLIB
  792. X      (void) fputs(s, stdout);
  793. X- #else
  794. X- # ifdef __STDC__
  795. X-     tputs(s, 1, (int (*)())xputc);
  796. X  # else
  797. X      tputs(s, 1, xputc);
  798. X  # endif
  799. X  #endif
  800. X  }
  801. X  
  802. X--- 476,493 ----
  803. X  xputs(s)
  804. X  char *s;
  805. X  {
  806. X! #ifndef MACOS
  807. X! # ifndef TERMLIB
  808. X      (void) fputs(s, stdout);
  809. X  # else
  810. X+ #  ifdef __STDC__
  811. X+     tputs(s, 1, (int (*)())xputc);
  812. X+ #  else
  813. X      tputs(s, 1, xputc);
  814. X+ #  endif
  815. X  # endif
  816. X+ #else
  817. X+     mputs(s);
  818. X  #endif
  819. X  }
  820. X  
  821. X***************
  822. X*** 534,540 ****
  823. X  }
  824. X  #endif
  825. X  
  826. X! #ifndef MSDOS
  827. X  # ifdef VMS
  828. X  static const short tmspc10[] = {        /* from termcap */
  829. X      0, 2000, 1333, 909, 743, 666, 333, 166, 83, 55, 50, 41, 27, 20, 13, 10,
  830. X--- 597,603 ----
  831. X  }
  832. X  #endif
  833. X  
  834. X! #if !defined(MSDOS) && !defined(MACOS)
  835. X  # ifdef VMS
  836. X  static const short tmspc10[] = {        /* from termcap */
  837. X      0, 2000, 1333, 909, 743, 666, 333, 166, 83, 55, 50, 41, 27, 20, 13, 10,
  838. X***************
  839. X*** 552,558 ****
  840. X      /* delay 50 ms - could also use a 'nap'-system call */
  841. X      /* BUG: if the padding character is visible, as it is on the 5620
  842. X         then this looks terrible. */
  843. X! #ifdef MSDOS
  844. X      /* simulate the delay with "cursor here" */
  845. X      register int i;
  846. X      for (i = 0; i < 3; i++) {
  847. X--- 615,621 ----
  848. X      /* delay 50 ms - could also use a 'nap'-system call */
  849. X      /* BUG: if the padding character is visible, as it is on the 5620
  850. X         then this looks terrible. */
  851. X! #if defined(MSDOS) || defined(MACOS)
  852. X      /* simulate the delay with "cursor here" */
  853. X      register int i;
  854. X      for (i = 0; i < 3; i++) {
  855. X***************
  856. X*** 559,576 ****
  857. X          cmov(curx, cury);
  858. X          (void) fflush(stdout);
  859. X      }
  860. X! #else /* MSDOS /**/
  861. X      if(!flags.nonull)
  862. X! #ifdef TERMINFO
  863. X          /* cbosgd!cbcephus!pds for SYS V R2 */
  864. X! # ifdef __STDC__
  865. X          tputs("$<50>", 1, (int (*)())xputc);
  866. X! # else
  867. X          tputs("$<50>", 1, xputc);
  868. X! # endif
  869. X! #else
  870. X          tputs("50", 1, xputs);
  871. X! #endif
  872. X  
  873. X      else if(ospeed > 0 || ospeed < SIZE(tmspc10)) if(CM) {
  874. X          /* delay by sending cm(here) an appropriate number of times */
  875. X--- 622,639 ----
  876. X          cmov(curx, cury);
  877. X          (void) fflush(stdout);
  878. X      }
  879. X! #else /* MSDOS || MACOS */
  880. X      if(!flags.nonull)
  881. X! # ifdef TERMINFO
  882. X          /* cbosgd!cbcephus!pds for SYS V R2 */
  883. X! #  ifdef __STDC__
  884. X          tputs("$<50>", 1, (int (*)())xputc);
  885. X! #  else
  886. X          tputs("$<50>", 1, xputc);
  887. X! #  endif
  888. X! # else
  889. X          tputs("50", 1, xputs);
  890. X! # endif
  891. X  
  892. X      else if(ospeed > 0 || ospeed < SIZE(tmspc10)) if(CM) {
  893. X          /* delay by sending cm(here) an appropriate number of times */
  894. X***************
  895. X*** 582,588 ****
  896. X              i -= cmlen*tmspc10[ospeed];
  897. X          }
  898. X      }
  899. X! #endif /* MSDOS /**/
  900. X  }
  901. X  
  902. X  void
  903. X--- 645,651 ----
  904. X              i -= cmlen*tmspc10[ospeed];
  905. X          }
  906. X      }
  907. X! #endif /* MSDOS || MACOS */
  908. X  }
  909. X  
  910. X  void
  911. X*** src/Old/timeout.c    Sun Oct 15 19:03:33 1989
  912. X--- src/timeout.c    Tue Oct  3 21:54:02 1989
  913. X***************
  914. X*** 25,30 ****
  915. X--- 25,56 ----
  916. X          nomul(-3);
  917. X  }
  918. X  
  919. X+ /* He is getting sicker and sicker prior to vomiting */
  920. X+ static const char *vomiting_texts[] = {
  921. X+     "You are feeling mildly nauseous.",    /* 11 */
  922. X+     "You feel slightly confused.",        /* 8 */
  923. X+     "You can't seem to think straight.",    /* 5 */
  924. X+     "You feel incredibly sick.",        /* 2 */
  925. X+     "You suddenly vomit!"            /* 0 */
  926. X+ };
  927. X+ 
  928. X+ static void
  929. X+ vomiting_dialogue() {
  930. X+     register long i = (Vomiting & TIMEOUT) / 3L;
  931. X+ 
  932. X+     if(!((Vomiting & TIMEOUT) % 3L) &&
  933. X+        i >= 0 && i < SIZE(vomiting_texts))
  934. X+         pline(vomiting_texts[SIZE(vomiting_texts) - i]);
  935. X+ 
  936. X+     switch(i) {
  937. X+ 
  938. X+         case 0:    vomit(); morehungry(20); break;
  939. X+         case 2:    make_confused(HConfusion + d(2,4), FALSE);
  940. X+         case 3:    make_stunned(HStun + d(2,4), FALSE);
  941. X+         default:    break;
  942. X+     }
  943. X+ }
  944. X+ 
  945. X  static const char *choke_texts[] = {
  946. X      "You find it hard to breathe.",
  947. X      "You're gasping for air.",
  948. X***************
  949. X*** 50,55 ****
  950. X--- 76,82 ----
  951. X      int sleeptime;
  952. X  
  953. X      if(Stoned) stoned_dialogue();
  954. X+     if(Vomiting) vomiting_dialogue();
  955. X      if(Strangled) choke_dialogue();
  956. X  #ifdef POLYSELF
  957. X      if(u.mtimedone) if(!--u.mtimedone) rehumanize();
  958. X***************
  959. X*** 80,85 ****
  960. X--- 107,115 ----
  961. X          case STONED:
  962. X              if (!killer) killer = "cockatrice";
  963. X              done(STONING);
  964. X+             break;
  965. X+         case VOMITING:
  966. X+             make_vomiting(0L, TRUE);
  967. X              break;
  968. X          case SICK:
  969. X              You("die from food poisoning.");
  970. X*** src/Old/topten.c    Sun Oct 15 19:04:05 1989
  971. X--- src/topten.c    Sat Oct 14 22:46:36 1989
  972. X***************
  973. X*** 6,12 ****
  974. X--- 6,17 ----
  975. X  #define MONATTK_H
  976. X  #include "hack.h"
  977. X  
  978. X+ #ifndef MACOS
  979. X  #include <errno.h>    /* George Barbanis */
  980. X+ #else
  981. X+ extern short macflags;
  982. X+ extern WindowPtr    HackWindow;
  983. X+ #endif
  984. X  #ifdef NO_FILE_LINKS
  985. X  #include <fcntl.h>    /* Ralf Brown */
  986. X  #endif
  987. X***************
  988. X*** 73,84 ****
  989. X  # endif /* UNIX or VMS */
  990. X  #endif /* LOGFILE */
  991. X  
  992. X! #ifdef MSDOS
  993. X  #define HUP
  994. X  #else
  995. X  #define    HUP    if(!done_hup)
  996. X  #endif
  997. X! 
  998. X      /* create a new 'topten' entry */
  999. X      t0 = newttentry();
  1000. X      t0->level = dlevel;
  1001. X--- 78,92 ----
  1002. X  # endif /* UNIX or VMS */
  1003. X  #endif /* LOGFILE */
  1004. X  
  1005. X! #if defined(MSDOS) || defined(MACOS)
  1006. X  #define HUP
  1007. X  #else
  1008. X  #define    HUP    if(!done_hup)
  1009. X  #endif
  1010. X! #ifdef MACOS
  1011. X!     macflags &= ~fDoUpdate;
  1012. X!     uid = TickCount();
  1013. X! #endif
  1014. X      /* create a new 'topten' entry */
  1015. X      t0 = newttentry();
  1016. X      t0->level = dlevel;
  1017. X***************
  1018. X*** 178,184 ****
  1019. X--- 186,216 ----
  1020. X              sleep(1);
  1021. X      }
  1022. X  #endif /* UNIX or VMS */
  1023. X+ #ifdef MACOS
  1024. X+     {
  1025. X+         term_info    *t;
  1026. X+         
  1027. X+         t = (term_info *)GetWRefCon(HackWindow);
  1028. X+         SetVol((StringPtr)0L, t->recordVRefNum);
  1029. X+         if (!(rfile = fopen(recfile,"r"))) {
  1030. X+             short    i;
  1031. X+     
  1032. X+             rfile = openFile(recfile);
  1033. X+             
  1034. X+             t = (term_info *)GetWRefCon(HackWindow);
  1035. X+             for (i = 0;i < t->maxRow; i++) {
  1036. X+                 MoveTo(Screen_Border,
  1037. X+                 t->ascent + (i * t->height) + Screen_Border);
  1038. X+                 DrawText(&t->screen[i][0], 0, t->maxCol);
  1039. X+             }
  1040. X+             ValidRect(&(**(*HackWindow).visRgn).rgnBBox);
  1041. X+         }
  1042. X+     }
  1043. X+ 
  1044. X+     if (!rfile) {
  1045. X+ #else
  1046. X      if(!(rfile = fopen(recfile,"r"))){
  1047. X+ #endif
  1048. X          HUP (void) puts("Cannot open record file!");
  1049. X          goto unlock;
  1050. X      }
  1051. X***************
  1052. X*** 337,347 ****
  1053. X      char linebuf[BUFSZ];
  1054. X      register char *bp;
  1055. X  
  1056. X!     Strcpy(linebuf, " No  Points   Name");
  1057. X      bp = eos(linebuf);
  1058. X      while(bp < linebuf + COLNO - 9) *bp++ = ' ';
  1059. X      Strcpy(bp, "Hp [max]");
  1060. X      (void) puts(linebuf);
  1061. X  }
  1062. X  
  1063. X  /* so>0: standout line; so=0: ordinary line; so<0: no output, return lth */
  1064. X--- 369,382 ----
  1065. X      char linebuf[BUFSZ];
  1066. X      register char *bp;
  1067. X  
  1068. X!     Strcpy(linebuf, " No  Points     Name");
  1069. X      bp = eos(linebuf);
  1070. X      while(bp < linebuf + COLNO - 9) *bp++ = ' ';
  1071. X      Strcpy(bp, "Hp [max]");
  1072. X      (void) puts(linebuf);
  1073. X+ #ifdef MACOS
  1074. X+     putchar('\n');
  1075. X+ #endif
  1076. X  }
  1077. X  
  1078. X  /* so>0: standout line; so=0: ordinary line; so<0: no output, return lth */
  1079. X***************
  1080. X*** 423,429 ****
  1081. X--- 458,468 ----
  1082. X        if (lngr >= hppos) hppos = (2*COLNO) - 7 - strlen(hpbuf);
  1083. X        if(bp <= linebuf + hppos) {
  1084. X          /* pad any necessary blanks to the hit point entry */
  1085. X+ #ifdef MACOS
  1086. X+         while(bp <= linebuf + hppos) *bp++ = ' ';
  1087. X+ #else
  1088. X          while(bp < linebuf + hppos) *bp++ = ' ';
  1089. X+ #endif
  1090. X          Strcpy(bp, hpbuf);
  1091. X          if(t1->maxhp < 10)
  1092. X           Sprintf(eos(bp), "   [%d]", t1->maxhp);
  1093. X***************
  1094. X*** 439,447 ****
  1095. X--- 478,492 ----
  1096. X        while(bp < linebuf + so) *bp++ = ' ';
  1097. X        *bp = 0;
  1098. X        standoutbeg();
  1099. X+ #ifdef MACOS
  1100. X+       puts(linebuf);
  1101. X+ #else
  1102. X        (void) fputs(linebuf,stdout);
  1103. X+ #endif
  1104. X        standoutend();
  1105. X+ #ifndef MACOS
  1106. X        (void) putchar('\n');
  1107. X+ #endif
  1108. X      }
  1109. X      return(strlen(linebuf));
  1110. X  }
  1111. X***************
  1112. X*** 506,513 ****
  1113. X  #else
  1114. X      char *player0;
  1115. X  #endif
  1116. X! 
  1117. X      if(!(rfile = fopen(recfile,"r"))){
  1118. X          (void) puts("Cannot open record file!");
  1119. X          return;
  1120. X      }
  1121. X--- 551,563 ----
  1122. X  #else
  1123. X      char *player0;
  1124. X  #endif
  1125. X! #ifdef MACOS
  1126. X!     if(!(rfile = fopen(recfile,"r")))
  1127. X!         rfile = openFile(recfile);
  1128. X!     if (!rfile) {
  1129. X! #else
  1130. X      if(!(rfile = fopen(recfile,"r"))){
  1131. X+ #endif
  1132. X          (void) puts("Cannot open record file!");
  1133. X          return;
  1134. X      }
  1135. X***************
  1136. X*** 679,686 ****
  1137. X--- 729,743 ----
  1138. X  
  1139. X      if (!otmp) return((struct obj *) 0);
  1140. X  
  1141. X+ #ifdef MACOS
  1142. X      if(!(rfile = fopen(recfile,"r")))
  1143. X+         rfile = openFile(recfile);
  1144. X+     if (!rfile) {
  1145. X+ #else
  1146. X+     if(!(rfile = fopen(recfile,"r"))){
  1147. X+ #endif
  1148. X          panic("Cannot open record file!");
  1149. X+     }
  1150. X  
  1151. X      tt = newttentry();
  1152. X      rank = rnd(10);
  1153. X*** src/Old/trap.c    Sun Oct 15 19:04:46 1989
  1154. X--- src/trap.c    Sat Oct 14 20:40:15 1989
  1155. X***************
  1156. X*** 287,293 ****
  1157. X  #endif
  1158. X                  unsee();
  1159. X                  (void) fflush(stdout);
  1160. X!                 goto_level(newlevel, FALSE);
  1161. X  #ifdef WALKIES
  1162. X              }
  1163. X  #endif
  1164. X--- 287,293 ----
  1165. X  #endif
  1166. X                  unsee();
  1167. X                  (void) fflush(stdout);
  1168. X!                 goto_level(newlevel, FALSE, TRUE);
  1169. X  #ifdef WALKIES
  1170. X              }
  1171. X  #endif
  1172. X***************
  1173. X*** 695,701 ****
  1174. X  #ifdef WALKIES
  1175. X              if(teleport_pet(mtmp)) {
  1176. X  #endif
  1177. X!                 rloc(mtmp);
  1178. X                  if(in_sight && !cansee(mtmp->mx,mtmp->my))
  1179. X                  pline("%s suddenly disappears!",
  1180. X                      Monnam(mtmp));
  1181. X--- 695,706 ----
  1182. X  #ifdef WALKIES
  1183. X              if(teleport_pet(mtmp)) {
  1184. X  #endif
  1185. X!                 /* Note: don't remove the trap if a vault.  Other-
  1186. X!                  * the monster will be stuck there, since the guard
  1187. X!                  * isn't going to come for it...
  1188. X!                  */
  1189. X!                 if (trap->once) vloc(mtmp);
  1190. X!                 else rloc(mtmp);
  1191. X                  if(in_sight && !cansee(mtmp->mx,mtmp->my))
  1192. X                  pline("%s suddenly disappears!",
  1193. X                      Monnam(mtmp));
  1194. X***************
  1195. X*** 989,1006 ****
  1196. X  #endif
  1197. X  
  1198. X      trap = t_at(u.ux, u.uy);
  1199. X!     if (trap && (!trap->tseen || trap->ttyp != TELEP_TRAP || trap->once))
  1200. X          trap = 0;
  1201. X  
  1202. X!     if (trap) 
  1203. X!         You("jump onto the teleportation trap...");
  1204. X!     else if(!Teleportation ||
  1205. X         (u.ulevel < (pl_character[0] == 'W' ? 8 : 12)
  1206. X  #ifdef POLYSELF
  1207. X          && !can_teleport(uasmon)
  1208. X  #endif
  1209. X         )
  1210. X!       ) {
  1211. X  #ifdef SPELLS
  1212. X          /* Try to use teleport away spell. */
  1213. X          castit = objects[SPE_TELEPORT_AWAY].oc_name_known;
  1214. X--- 994,1023 ----
  1215. X  #endif
  1216. X  
  1217. X      trap = t_at(u.ux, u.uy);
  1218. X!     if (trap && (!trap->tseen || trap->ttyp != TELEP_TRAP))
  1219. X          trap = 0;
  1220. X  
  1221. X!     if (trap) {
  1222. X!         if (trap->once) {
  1223. X!             pline("This is a vault teleport, usable once only.");
  1224. X!             pline("Jump in? ");
  1225. X!             if (yn() == 'n')
  1226. X!                 trap = 0;
  1227. X!             else {
  1228. X!                 deltrap(trap);
  1229. X!                 newsym(u.ux, u.uy);
  1230. X!             }
  1231. X!         }
  1232. X!         if (trap)
  1233. X!             You("jump onto the teleportation trap...");
  1234. X!     }
  1235. X!     if(!trap && (!Teleportation ||
  1236. X         (u.ulevel < (pl_character[0] == 'W' ? 8 : 12)
  1237. X  #ifdef POLYSELF
  1238. X          && !can_teleport(uasmon)
  1239. X  #endif
  1240. X         )
  1241. X!       )) {
  1242. X  #ifdef SPELLS
  1243. X          /* Try to use teleport away spell. */
  1244. X          castit = objects[SPE_TELEPORT_AWAY].oc_name_known;
  1245. X***************
  1246. X*** 1053,1059 ****
  1247. X  #ifdef WALKIES
  1248. X      if(next_to_u()) {
  1249. X  #endif
  1250. X!         tele();
  1251. X  #ifdef WALKIES
  1252. X          (void) next_to_u();
  1253. X      } else {
  1254. X--- 1070,1077 ----
  1255. X  #ifdef WALKIES
  1256. X      if(next_to_u()) {
  1257. X  #endif
  1258. X!         if (trap && trap->once) vtele();
  1259. X!         else tele();
  1260. X  #ifdef WALKIES
  1261. X          (void) next_to_u();
  1262. X      } else {
  1263. X***************
  1264. X*** 1073,1079 ****
  1265. X          impossible("Where are your chain and ball??");
  1266. X          return;
  1267. X      }
  1268. X!     place_object(uball, u.ux, u.uy);
  1269. X      place_object(uchain, u.ux, u.uy);
  1270. X      if(attach){
  1271. X          uchain->nobj = fobj;
  1272. X--- 1091,1098 ----
  1273. X          impossible("Where are your chain and ball??");
  1274. X          return;
  1275. X      }
  1276. X!     if(!carried(uball))
  1277. X!         place_object(uball, u.ux, u.uy);
  1278. X      place_object(uchain, u.ux, u.uy);
  1279. X      if(attach){
  1280. X          uchain->nobj = fobj;
  1281. X***************
  1282. X*** 1190,1196 ****
  1283. X          You("shudder for a moment...");
  1284. X      else
  1285. X  #endif
  1286. X!         goto_level(newlevel, FALSE);
  1287. X  }
  1288. X  
  1289. X  void
  1290. X--- 1209,1215 ----
  1291. X          You("shudder for a moment...");
  1292. X      else
  1293. X  #endif
  1294. X!         goto_level(newlevel, FALSE, FALSE);
  1295. X  }
  1296. X  
  1297. X  void
  1298. X*** src/Old/uhitm.c    Sun Oct 15 19:06:01 1989
  1299. X--- src/uhitm.c    Sun Oct 15 17:25:18 1989
  1300. X***************
  1301. X*** 873,878 ****
  1302. X--- 873,885 ----
  1303. X              if (!Blind) pline("%s is frozen by you!", Monnam(mdef));
  1304. X              mdef->mfroz = 1;
  1305. X          }
  1306. X+         case AD_SLEE:
  1307. X+         if (!resists_sleep(mdef->data) && !mdef->msleep &&
  1308. X+                                 !mdef->mfroz) {
  1309. X+             if (!Blind)
  1310. X+             pline("%s suddenly falls asleep!", Monnam(mdef));
  1311. X+             mdef->msleep = 1;
  1312. X+         }
  1313. X          break;
  1314. X          default:    tmp = 0;
  1315. X              break;
  1316. X*** src/Old/unixmain.c    Wed Sep 27 23:21:24 1989
  1317. X--- src/unixmain.c    Mon Oct 16 22:34:33 1989
  1318. X***************
  1319. X*** 3,8
  1320. X  /* NetHack may be freely redistributed.  See license for details. */
  1321. X  /* main.c - Unix NetHack */
  1322. X  
  1323. X  #include <signal.h>
  1324. X  #include <pwd.h>
  1325. X  
  1326. X
  1327. X--- 3,10 -----
  1328. X  /* NetHack may be freely redistributed.  See license for details. */
  1329. X  /* main.c - Unix NetHack */
  1330. X  
  1331. X+ #include "hack.h"
  1332. X+ 
  1333. X  #include <signal.h>
  1334. X  #include <pwd.h>
  1335. X  
  1336. X***************
  1337. X*** 5,12
  1338. X  
  1339. X  #include <signal.h>
  1340. X  #include <pwd.h>
  1341. X- 
  1342. X- #include "hack.h"
  1343. X  
  1344. X  char SAVEF[PL_NSIZ + 11] = "save/";    /* save/99999player */
  1345. X  
  1346. X
  1347. X--- 7,12 -----
  1348. X  
  1349. X  #include <signal.h>
  1350. X  #include <pwd.h>
  1351. X  
  1352. X  char SAVEF[PL_NSIZ + 11] = "save/";    /* save/99999player */
  1353. X  
  1354. X*** src/Old/version.c    Sun Oct 15 19:07:34 1989
  1355. X--- src/version.c    Sat Oct 14 22:35:53 1989
  1356. X***************
  1357. X*** 35,40 ****
  1358. X--- 35,43 ----
  1359. X  #  endif
  1360. X  # endif
  1361. X  #endif
  1362. X+ #ifdef MACOS
  1363. X+         "Macintosh",
  1364. X+ #endif
  1365. X  #ifdef UNIX
  1366. X          "Unix",
  1367. X  #endif
  1368. X*** src/Old/zap.c    Sun Oct 15 19:09:13 1989
  1369. X--- src/zap.c    Thu Oct  5 11:18:40 1989
  1370. X***************
  1371. X*** 1163,1169 ****
  1372. X              shieldeff(mon->mx, mon->my);
  1373. X              break;
  1374. X              }
  1375. X!             type = 0; /* so they don't get saving throws */
  1376. X          }
  1377. X          tmp = mon->mhp+1;
  1378. X          break;
  1379. X--- 1163,1172 ----
  1380. X              shieldeff(mon->mx, mon->my);
  1381. X              break;
  1382. X              }
  1383. X!             type = -1; /* so they don't get saving throws */
  1384. X!         } else if (resists_disint(mon->data)) {
  1385. X!             shieldeff(mon->mx, mon->my);
  1386. X!             break;
  1387. X          }
  1388. X          tmp = mon->mhp+1;
  1389. X          break;
  1390. X***************
  1391. X*** 1535,1548 ****
  1392. X                      break;
  1393. X                  case 4:        /* death */
  1394. X                      if(type == -24) { /* disintegration */
  1395. X!                     if(uarms) {
  1396. X                          (void) destroy_arm(uarms);
  1397. X!                     } else if (uarm) {
  1398. X!                 if (Disint_resistance & WORN_ARMOR)
  1399. X!                     Your("armor absorbs the blast!");
  1400. X!                 else (void) destroy_arm(uarm);
  1401. X                      }
  1402. X-                     break;
  1403. X                      }
  1404. X  #ifdef POLYSELF
  1405. X                      else if(is_undead(uasmon)) {
  1406. X--- 1538,1553 ----
  1407. X                      break;
  1408. X                  case 4:        /* death */
  1409. X                      if(type == -24) { /* disintegration */
  1410. X!                     if (Disint_resistance) {
  1411. X!                         You("are not disintegrated.");
  1412. X!                         break;
  1413. X!                     } else if(uarms) {
  1414. X                          (void) destroy_arm(uarms);
  1415. X!                         break;
  1416. X!                     } else if (uarm)  {
  1417. X!                         (void) destroy_arm(uarm);
  1418. X!                         break;
  1419. X                      }
  1420. X                      }
  1421. X  #ifdef POLYSELF
  1422. X                      else if(is_undead(uasmon)) {
  1423. X*** src/Old/Makefile.src    Sun Oct 15 19:47:21 1989
  1424. X--- src/Makefile.src    Wed Oct  4 11:04:24 1989
  1425. X***************
  1426. X*** 103,113 ****
  1427. X  
  1428. X  CSOURCES = $(HACKCSRC) $(TARGSRC) $(MAKESRC) $(SPLEVSRC)
  1429. X  
  1430. X! HACKINCL = artifact.h attrib.h config.h coord.h decl.h edog.h epri.h eshk.h\
  1431. X!        extern.h flag.h func_tab.h global.h gold.h hack.h lev.h mfndpos.h\
  1432. X!        mkroom.h monattk.h mondata.h monflag.h monst.h monsym.h msdos.h\
  1433. X!        obj.h objclass.h permonst.h prop.h rm.h sp_lev.h spell.h tradstdc.h\
  1434. X!        trapname.h vault.h wseg.h you.h youprop.h
  1435. X  
  1436. X  # all .h files except date.h, onames.h, pm.h & trap.h which would cause
  1437. X  # dependency loops if run through "make depend".
  1438. X--- 103,115 ----
  1439. X  
  1440. X  CSOURCES = $(HACKCSRC) $(TARGSRC) $(MAKESRC) $(SPLEVSRC)
  1441. X  
  1442. X! HACKINCL = amiconf.h artifact.h attrib.h color.h config.h coord.h decl.h\
  1443. X!        def_os2.h edog.h epri.h eshk.h extern.h flag.h func_tab.h global.h\
  1444. X!        gold.h hack.h lev.h mfndpos.h mkroom.h monattk.h mondata.h monflag.h\
  1445. X!        monst.h monsym.h msdos.h obj.h objclass.h patchlevel.h pcconf.h\
  1446. X!        permonst.h prop.h rm.h sp_lev.h spell.h system.h tosconf.h\
  1447. X!        tradstdc.h trapname.h unixconf.h vault.h vmsconf.h wseg.h you.h\
  1448. X!        youprop.h
  1449. X  
  1450. X  # all .h files except date.h, onames.h, pm.h & trap.h which would cause
  1451. X  # dependency loops if run through "make depend".
  1452. X***************
  1453. X*** 290,306 ****
  1454. X  #        ( /bin/grep '^#[     ]*include' $$i | sed -n \
  1455. X  #            -e 's,<\(.*\)>,"/usr/include/\1",' \
  1456. X  #
  1457. X  #
  1458. X      for i in ${HACKCSRC}; do \
  1459. X          ( /bin/grep '^#[     ]*include[     ]*"' $$i | sed -n \
  1460. X              -e 's/[^"]*"\([^"]*\)".*/\1/' \
  1461. X              -e 's/.*\.h/..\/include\/&/' \
  1462. X              -e H -e '$$g' -e '$$s/\n/ /g' \
  1463. X              -e '$$s/.*/'$$i': &/' -e '$$s/\.c:/.o:/p' \
  1464. X              >> makedep); done
  1465. X      for i in ${HACKINCL}; do \
  1466. X!         ( /bin/grep '^#[     ]*include[     ]*"' ../include/$$i | sed -n \
  1467. X              -e 's/[^"]*"\([^"]*\)".*/\1/' \
  1468. X              -e 's/.*\.h/..\/include\/&/' \
  1469. X              -e H -e '$$g' -e '$$s/\n/ /g' \
  1470. X              -e '$$s/.*/..\/include\/'$$i': &\
  1471. X--- 292,318 ----
  1472. X  #        ( /bin/grep '^#[     ]*include' $$i | sed -n \
  1473. X  #            -e 's,<\(.*\)>,"/usr/include/\1",' \
  1474. X  #
  1475. X+ # extern.h is ignored, even though its declared function types may affect the
  1476. X+ # compilation of all the .c files, since extern.h changes every time the
  1477. X+ # type of an external function does, and we would spend all our time recompiling
  1478. X+ # if we did not ignore it.  the risk is minimal, as lint should pick up any
  1479. X+ # calls to the modified function that were not modified accordingly.
  1480. X  #
  1481. X+ # patchlev.h is the name MS-DOS uses to refer to patchlevel.h after it gets
  1482. X+ # through truncating the name, but it does not really exist
  1483. X+ #
  1484. X      for i in ${HACKCSRC}; do \
  1485. X          ( /bin/grep '^#[     ]*include[     ]*"' $$i | sed -n \
  1486. X              -e 's/[^"]*"\([^"]*\)".*/\1/' \
  1487. X+             -e 's/patchlev.h//' \
  1488. X              -e 's/.*\.h/..\/include\/&/' \
  1489. X              -e H -e '$$g' -e '$$s/\n/ /g' \
  1490. X              -e '$$s/.*/'$$i': &/' -e '$$s/\.c:/.o:/p' \
  1491. X              >> makedep); done
  1492. X      for i in ${HACKINCL}; do \
  1493. X!         ( /bin/grep '^#[     ]*include[     ]*"' ../include/$$i | sed -n \
  1494. X              -e 's/[^"]*"\([^"]*\)".*/\1/' \
  1495. X+             -e 's/extern.h//' \
  1496. X              -e 's/.*\.h/..\/include\/&/' \
  1497. X              -e H -e '$$g' -e '$$s/\n/ /g' \
  1498. X              -e '$$s/.*/..\/include\/'$$i': &\
  1499. X***************
  1500. X*** 315,321 ****
  1501. X      @echo '# DEPENDENCIES MUST END AT END OF FILE' >> Makefile
  1502. X      @echo '# IF YOU PUT STUFF HERE IT WILL GO AWAY' >> Makefile
  1503. X      @echo '# see make depend above' >> Makefile
  1504. X!     - diff Makefile Makefile.bak
  1505. X      @rm -f Makefile.bak
  1506. X  
  1507. X  # PC dependency for Systos that won't be made on a UNIX system
  1508. X--- 327,333 ----
  1509. X      @echo '# DEPENDENCIES MUST END AT END OF FILE' >> Makefile
  1510. X      @echo '# IF YOU PUT STUFF HERE IT WILL GO AWAY' >> Makefile
  1511. X      @echo '# see make depend above' >> Makefile
  1512. X!     - diff Makefile.bak Makefile
  1513. X      @rm -f Makefile.bak
  1514. X  
  1515. X  # PC dependency for Systos that won't be made on a UNIX system
  1516. X***************
  1517. X*** 363,373 ****
  1518. X  mon.o:  ../include/hack.h ../include/mfndpos.h ../include/artifact.h ../include/wseg.h
  1519. X  mondata.o:  ../include/hack.h ../include/eshk.h ../include/epri.h
  1520. X  monmove.o:  ../include/hack.h ../include/mfndpos.h ../include/artifact.h
  1521. X! monst.o:  ../include/config.h ../include/permonst.h ../include/monsym.h ../include/eshk.h ../include/vault.h ../include/epri.h ../include/decl.h
  1522. X  mthrowu.o:  ../include/hack.h
  1523. X  music.o:  ../include/hack.h
  1524. X  o_init.o:  ../include/hack.h
  1525. X! objects.o:  ../include/config.h ../include/obj.h ../include/objclass.h ../include/prop.h ../include/decl.h
  1526. X  objnam.o:  ../include/hack.h
  1527. X  options.o:  ../include/hack.h
  1528. X  pager.o:  ../include/hack.h
  1529. X--- 375,385 ----
  1530. X  mon.o:  ../include/hack.h ../include/mfndpos.h ../include/artifact.h ../include/wseg.h
  1531. X  mondata.o:  ../include/hack.h ../include/eshk.h ../include/epri.h
  1532. X  monmove.o:  ../include/hack.h ../include/mfndpos.h ../include/artifact.h
  1533. X! monst.o:  ../include/config.h ../include/permonst.h ../include/monsym.h ../include/eshk.h ../include/vault.h ../include/epri.h ../include/color.h
  1534. X  mthrowu.o:  ../include/hack.h
  1535. X  music.o:  ../include/hack.h
  1536. X  o_init.o:  ../include/hack.h
  1537. X! objects.o:  ../include/config.h ../include/obj.h ../include/objclass.h ../include/prop.h ../include/color.h
  1538. X  objnam.o:  ../include/hack.h
  1539. X  options.o:  ../include/hack.h
  1540. X  pager.o:  ../include/hack.h
  1541. X***************
  1542. X*** 401,407 ****
  1543. X  u_init.o:  ../include/hack.h
  1544. X  uhitm.o:  ../include/hack.h ../include/artifact.h
  1545. X  vault.o:  ../include/hack.h ../include/vault.h
  1546. X! version.o:  ../include/hack.h ../include/date.h ../include/patchlevel.h
  1547. X  weapon.o:  ../include/hack.h
  1548. X  were.o:  ../include/hack.h
  1549. X  wield.o:  ../include/hack.h
  1550. X--- 413,419 ----
  1551. X  u_init.o:  ../include/hack.h
  1552. X  uhitm.o:  ../include/hack.h ../include/artifact.h
  1553. X  vault.o:  ../include/hack.h ../include/vault.h
  1554. X! version.o:  ../include/hack.h ../include/date.h  ../include/patchlevel.h
  1555. X  weapon.o:  ../include/hack.h
  1556. X  were.o:  ../include/hack.h
  1557. X  wield.o:  ../include/hack.h
  1558. X***************
  1559. X*** 410,425 ****
  1560. X  worn.o:  ../include/hack.h
  1561. X  write.o:  ../include/hack.h
  1562. X  zap.o:  ../include/hack.h
  1563. X  ../include/config.h:  ../include/tradstdc.h ../include/global.h
  1564. X              touch ../include/config.h
  1565. X! ../include/decl.h:  ../include/spell.h ../include/obj.h ../include/you.h ../include/onames.h ../include/pm.h
  1566. X              touch ../include/decl.h
  1567. X  ../include/global.h:  ../include/coord.h ../include/vmsconf.h ../include/unixconf.h ../include/pcconf.h ../include/tosconf.h ../include/amiconf.h
  1568. X              touch ../include/global.h
  1569. X! ../include/hack.h:  ../include/config.h ../include/decl.h ../include/monsym.h ../include/mkroom.h ../include/objclass.h ../include/gold.h ../include/trap.h ../include/flag.h ../include/rm.h ../include/extern.h
  1570. X              touch ../include/hack.h
  1571. X  ../include/permonst.h:  ../include/monattk.h ../include/monflag.h
  1572. X              touch ../include/permonst.h
  1573. X  ../include/you.h:  ../include/attrib.h ../include/monst.h ../include/youprop.h
  1574. X              touch ../include/you.h
  1575. X  ../include/youprop.h:  ../include/prop.h ../include/permonst.h ../include/mondata.h ../include/pm.h
  1576. X--- 422,447 ----
  1577. X  worn.o:  ../include/hack.h
  1578. X  write.o:  ../include/hack.h
  1579. X  zap.o:  ../include/hack.h
  1580. X+ ../include/amiconf.h:  ../include/msdos.h ../include/pcconf.h
  1581. X+             touch ../include/amiconf.h
  1582. X  ../include/config.h:  ../include/tradstdc.h ../include/global.h
  1583. X              touch ../include/config.h
  1584. X! ../include/decl.h:  ../include/spell.h ../include/color.h ../include/obj.h ../include/you.h ../include/onames.h ../include/pm.h
  1585. X              touch ../include/decl.h
  1586. X  ../include/global.h:  ../include/coord.h ../include/vmsconf.h ../include/unixconf.h ../include/pcconf.h ../include/tosconf.h ../include/amiconf.h
  1587. X              touch ../include/global.h
  1588. X! ../include/hack.h:  ../include/config.h ../include/decl.h ../include/monsym.h ../include/mkroom.h ../include/objclass.h ../include/gold.h ../include/trap.h ../include/flag.h ../include/rm.h 
  1589. X              touch ../include/hack.h
  1590. X+ ../include/pcconf.h:  ../include/msdos.h ../include/system.h
  1591. X+             touch ../include/pcconf.h
  1592. X  ../include/permonst.h:  ../include/monattk.h ../include/monflag.h
  1593. X              touch ../include/permonst.h
  1594. X+ ../include/tosconf.h:  ../include/msdos.h ../include/pcconf.h
  1595. X+             touch ../include/tosconf.h
  1596. X+ ../include/unixconf.h:  ../include/system.h
  1597. X+             touch ../include/unixconf.h
  1598. X+ ../include/vmsconf.h:  ../include/system.h
  1599. X+             touch ../include/vmsconf.h
  1600. X  ../include/you.h:  ../include/attrib.h ../include/monst.h ../include/youprop.h
  1601. X              touch ../include/you.h
  1602. X  ../include/youprop.h:  ../include/prop.h ../include/permonst.h ../include/mondata.h ../include/pm.h
  1603. X
  1604. END_OF_FILE
  1605. if test 42408 -ne `wc -c <'patches05f'`; then
  1606.     echo shar: \"'patches05f'\" unpacked with wrong size!
  1607. fi
  1608. # end of 'patches05f'
  1609. fi
  1610. echo shar: End of archive 6 \(of 6\).
  1611. cp /dev/null ark6isdone
  1612. MISSING=""
  1613. for I in 1 2 3 4 5 6 ; do
  1614.     if test ! -f ark${I}isdone ; then
  1615.     MISSING="${MISSING} ${I}"
  1616.     fi
  1617. done
  1618. if test "${MISSING}" = "" ; then
  1619.     echo You have unpacked all 6 archives.
  1620.     rm -f ark[1-9]isdone
  1621. else
  1622.     echo You still need to unpack the following archives:
  1623.     echo "        " ${MISSING}
  1624. fi
  1625. ##  End of shell archive.
  1626. exit 0
  1627.